﻿using Prism.Commands;
using Prism.Mvvm;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace CIS.Client.Modules.Home.ViewModels
{
    public class HomeViewModel:BindableBase
    {
        private readonly IRegionManager _regionManager;
        private log4net.ILog _logger;

        public HomeViewModel(IRegionManager regionManager)
        {
            _regionManager = regionManager;
            _logger = log4net.LogManager.GetLogger("OperationLog");

            _logger.Info("主界面已打开");
        }






        public string? PageTitle { get; set; } = "首页";

        public string? NavUri { get; set; } = "HomeView";

        public bool IsCanClose { get; set; } = false;

        public DelegateCommand<string>? CloseCommand
        {
            get
            {
                return new DelegateCommand<string>(CloseFunction);
            }
        }

        private void CloseFunction(string navUri)
        {
            //var a = _regionManager.Regions["MainRegion"].ActiveViews.FirstOrDefault();
            //_regionManager.Regions["MainRegion"].Remove(a);
        }
    }
}
